<?php
    $per = imagecreate(300,38);
    $background = imagecolorallocate($per, 0x38, 0x38, 0x38);
    $foreground = imagecolorallocate($per, 0x00, 0x8A, 0x01);
    $white = imagecolorallocate($per, 255, 255, 255);
    $grey = imagecolorallocate($per, 128, 128, 128);
    $border = imagecolorallocate($per, 0x00, 0x00, 0x00);
            $text = '%';
        $font = 'arial.ttf';
    if ($_GET['per'] > 0)
    {
        $grad = imagecreatefrompng("img/percentlite.png");
        $per2 = imagecopy($per, $grad, 1, 1, 0, 0, ($_GET['per'] * 3), 36);
        imagerectangle($per, 0, 0, 300, 37, $border);
        imagettftext($per, 13, 0, 110, 27, $white, $font,$text);
        imagettftext($per, 13, 0, 130, 27, $grey, $font,$_GET['per']);
        imagettftext($per, 13, 0, 129, 26, $white, $font,$_GET['per']);
    }
    header("Content-type: image/png");
    imagepng($per, NULL, 5);
?> 